<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="row">
	<div class="col-lg-12">
		<div id="imagesDataList" class="row" style="min-height:300px;"></div>
	</div>
</div>
<script type="text/html" id="imagesDataTpl">
	<div id="item{{id}}" class="col-lg-4 col-md-4 col-sm-4">
		<div class="thumbnail">
			{{if !link}}
			<a href="#"><img src="${FTP_PATH}{{thumb}}"></a>
			{{else}}
			<a href="{{link}}" target="_blank"><img src="${FTP_PATH}{{thumb}}"></a>
			{{/if}}
			<div class="caption">
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
</script>
<script type="text/javascript">
$(loadImages);
var imagesSize = 0;
function loadImages(){
	$("#imagesDataList").empty();;
	$.post("${BASE_PATH}/bus/goods/store/imageDetailPage/${LunBoNum}",function(result){
		if(result.flag==0){
			$(result.object.reverse()).each(function(i,o){
				onAddImagesSuccess(o);
			});
		}
	},"json");
}
function onAddImagesSuccess(newObject){
	imagesSize++;
	$("#imagesDataList").prepend(template("imagesDataTpl",newObject));
	if(imagesSize>=50){
		$("#toAddGoodsImagesBtn").prop("disabled",true);
	}
}
 
</script>